package com.smart.entity.business;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.smart.model.excel.annotation.ExcelField;
import com.smart.model.excel.annotation.ExcelFields;
import com.smart.mybatis.annotation.Column;
import com.smart.mybatis.enums.QueryType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 采集器配置
 *
 * @author wf
 * @since 2025-07-14 16:30:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@FieldNameConstants
@TableName("collector")
@ExcelFields({
		@ExcelField(title = "采集器名称", attrName = "name",  align = ExcelField.Align.CENTER, sort = 1),
		@ExcelField(title = "采集器号", attrName = "collectorNumber",  align = ExcelField.Align.CENTER, sort = 2),
		@ExcelField(title = "公司名称", attrName = "companyName",  align = ExcelField.Align.CENTER, sort = 3),
		@ExcelField(title = "卡类型", attrName = "trafficCard",  align = ExcelField.Align.CENTER, sort = 4),
		@ExcelField(title = "电量", attrName = "electricity",  align = ExcelField.Align.CENTER, sort = 5),
		@ExcelField(title = "创建时间", attrName = "createDate",  align = ExcelField.Align.CENTER, sort = 6),
		@ExcelField(title = "更新时间", attrName = "updateDate",  align = ExcelField.Align.CENTER, sort = 7)
})
@Builder
public class CollectorEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Column(name = "id", queryType = QueryType.EQ)
	private String id;

	/**
	 * 采集器名称
	 */
	@Column(name = "name", queryType = QueryType.LIKE)
	private String name;

	/**
	 * 采集器号
	 */
	@Column(name = "collector_number", queryType = QueryType.EQ)
	private String collectorNumber;

	/**
	 * 公司名称
	 */
	private String companyName;

	/**
	 * 平台接口
	 */
	private String platInterface;

	/**
	 * 卡类型
	 */
	private String trafficCard;

	/**
	 * 唤醒模式
	 */
	private String awakeMode;

	/**
	 * 采集间隔
	 */
	private String ac;

	/**
	 * 通道数
	 */
	private Integer channelCount;
	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createDate;

	/**
	 * 状态（临时字段，不持久化到数据库）
	 */
	@TableField(exist = false)
	private String status;

	/**
	 * 更新时间 - 需要添加对应的字段
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime updateDate;

	/**
	 * 电量 - 需要添加对应的字段
	 */
	private String electricity;
}